import numpy as np

sequence1 = [0, 1, 0, 1, 0, 1, 1, 1]   # 第一个序列
sequence2 = [0, 1, 1, 0, 0, 1, 1, 1]   # 第二个序列

diff_sequence = np.bitwise_xor(sequence1, sequence2)    # 计算差分序列
diff_count = np.count_nonzero(diff_sequence)    # 统计差分次数

average_diff_prob = diff_count / len(diff_sequence)    # 计算平均差分概率
print("平均差分概率：", average_diff_prob)